package com.cjm.algorithm.leetcode;

import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;

class HuiWenChuan {
    public static int longestPalindrome(String s) {
        char[] chars = s.toCharArray();
        Map<String, Integer> map = new HashMap<>();
        Queue que = new LinkedBlockingQueue<>();
        int max = 0;
        int left = 0;
        for (int k = 0; k < chars.length; k++) {
            char current = chars[k];
            Integer integer = map.get(String.valueOf(current));
            if (integer != null) {
                Object poll = que.poll();
                if (poll != null && (char)poll != current) {

                }
            }
            if (integer == null) {
                left ++;
                max = Math.max(max, k - left);
            }
        }
        return max;
    }
}